Hi Ray, There isn't a direct mechanism for returning error codes from MCode C Programs as they run as a separate thread in separate hardware (KFLOP). I think you will need to have your Tool Change program set some indication of a failure that your application will then need to detect and do whatever you wish (Halt). KMotionCNC has a mechanism for sending commands to the PC (KMotionCNC) that include issuing a Halt. I would suggest you follow the same technique in the Application you wrote. The GetStatus Uploading process includes a few UserData variables that are intended for this purpose. KMotionCNC monitors these locations for commands that indicate it should do something (like tell the interpreter to Halt). So in summary: #1 In case of a failure during a tool change do a
: DoPC(PC_COMM_HALT); see KFLOPtoPCCmdExamples.c #2 Add into your Application's Status update process a monitor for such commands. There is a .NET export of GetPC_Comm_Status to obtain the communication words. Duplicate the functionality that KMotionCNC does to process commands in void CKMotionCNCDlg::ServiceKFLOPCommands()
HTH Regards TK
| Group: DynoMotion |
Message: 6372 |
From: Tom Kerekes |
Date: 1/1/2013 |
| Subject: Re: Aborting A Toolchange |
Hi Ray, There isn't a direct mechanism for returning error codes from MCode C Programs as they run as a separate thread in separate hardware (KFLOP). I think you will need to have your Tool Change program set some indication of a failure that your application will then need to detect and do whatever you wish (Halt). KMotionCNC has a mechanism for sending commands to the PC (KMotionCNC) that include issuing a Halt. I would suggest you follow the same technique in the Application you wrote. The GetStatus Uploading process includes a few UserData variables that are intended for this purpose. KMotionCNC monitors these locations for commands that indicate it should do something (like tell the interpreter to Halt). So in summary: #1 In case of a failure during a tool change do a
: DoPC(PC_COMM_HALT); see KFLOPtoPCCmdExamples.c #2 Add into your Application's Status update process a monitor for such commands. There is a .NET export of GetPC_Comm_Status to obtain the communication words. Duplicate the functionality that KMotionCNC does to process commands in void CKMotionCNCDlg::ServiceKFLOPCommands()
HTH Regards TK
| Group: DynoMotion |
Message: 6373 |
From: himykabibble |
Date: 1/1/2013 |
| Subject: Re: Aborting A Toolchange |
Tom,
That should handle it. Thanks!
BTW - Here's my toolchanger. Not fast, but it's been dead reliable.
http://www.youtube.com/watch?v=zjGi1WBTMBE
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Ray,
>
> There isn't a direct mechanism for returning error codes from MCode C Programs as they run as a separate thread in separate hardware (KFLOP).
>
> I think you will need to have your Tool Change program set some indication of a failure that your application will then need to detect and do whatever you wish (Halt).
>
> KMotionCNC has a mechanism for sending commands to the PC (KMotionCNC) that include issuing a Halt. I would suggest you follow the same technique in the Application you wrote. The GetStatus Uploading process includes a few UserData variables that are intended for this purpose. KMotionCNC monitors these locations for commands that indicate it should do something (like tell the interpreter to Halt).Â
>
> So in summary:
>
> #1 In case of a failure during a tool change do a :Â Â Â Â DoPC(PC_COMM_HALT);Â Â Â see KFLOPtoPCCmdExamples.c
>
> #2 Add into your Application's Status update process a monitor for such commands. There is a .NET export of GetPC_Comm_Status to obtain the communication words. Duplicate the functionality that KMotionCNC does to process commands in void CKMotionCNCDlg::ServiceKFLOPCommands()
>
> HTH
> Regards
> TK
>
>
>
>
>
> ________________________________
> From: himykabibble <jagboy1964@...>
> To: DynoMotion@yahoogroups.com
> Sent: Monday, December 31, 2012 9:20 PM
> Subject: [DynoMotion] Aborting A Toolchange
>
>
> Â
> Tom,
>
> I've just completed the toolchanger for my mill, but I want to add a means to allow a toolchange to fail gracefully due, for example, to a mechanical fault. Right now, M6 runs a KFlop program that performs the toolchange, which leaves me no way that I can see of returning a status that says "Completed" or "Failed". The "Completed" case would be simply a NOP, allowing execution to continue, while "Failed" should abort any G-code program in-process, and notify the user of the nature of the fault. How can I accomplish this without modifying the Interpreter (again)?
>
> BTW - Happy New Year!
>
> Regards,
> Ray L.
>
|
|
| | | |